package com.dynamic.mybatis.demo.redision;

import io.netty.buffer.ByteBuf;

/**
 * @Description
 * @Author xs
 * @Date 2023/3/28 14:54
 */
public class RedissionTest {
    public static void main(String[] args) {
         int a = -0x01ff;
         Object b = a  >> 8;

         //10000000 00000000 00000001 11111111    -0x01ff源码
         //11111111 11111111 11111110 00000000    -0x01ff反码
         //11111111 11111111 11111110 00000001    -0x01ff补码
         //10000000 11111111 11111111 11111110   -0x01ff补码 >> 8

         //10000000 00000000 00000000 00000010    -2源码
         //10000000 11111111 11111111 11111101    -2反码
         //10000000 11111111 11111111 11111110    -2补码

         System.out.println(b.getClass().getName());
         System.out.println(b);
         Object c = (a >> 8) & 0xff;
         System.out.println(c.getClass().getName());
         System.out.println(c);

    }


    public static Integer setIntBinarys(Integer source, int... nums) {
        ByteBuf byteBuf;
        int a = 1;
        for (int number : nums) {
            source = (source | (a << number));
        }
        return source;
    }
}